#include<iostream>
using namespace std;
void Sorting(int arr[], int n)
{
	for (int i = 2; i <= n; i++)
	{
		arr[0] = arr[i];
		int j = i - 1;
		while (arr[0] < arr[j]) {
			arr[j + 1] = arr[j];
			j--;
		}
		arr[j + 1] = arr[0];
	}
}
void Sort(int arr[], int n)
{
	for (int i = 2; i < n + 1; i++) {
		arr[0] = arr[i];
		int j = i - 1;
		while (arr[0] > arr[j]) {
			arr[j + 1] = arr[j];
			j--;
		}
		arr[j + 1] = arr[0];
	}
}
void Sort(int arr[], int n)
{
	for (int i = 2; i < n + 1; i++) {
		int j = i - 1;
		arr[0] = arr[i];
		while (arr[0] > arr[j]) {
			arr[j + 1] = arr[j];
			j--;
		}
		arr[j + 1] = arr[0];
	}
}
void test()
{
	for (int i = 0, j = 0; i < n; i++) {
		temp[arr[i]]++;
		while (temp[arr[j]] > 1) {
			temp[arr[j]]--;
			j++;
		}
		res = max(res, i - j + 1);
	}
}